package com.liezh.state;

/**
 * @author liezh
 * @date 2021-10-29
 */
public class InTransitionState implements PackageState {
    //Singleton
    private static InTransitionState instance = new InTransitionState();

    private InTransitionState() {}

    public static InTransitionState instance() {
        return instance;
    }

    //Business logic and state transition
    @Override
    public void updateState(PackageContext ctx) {
        System.out.println("3 - Package is in transition !!");
        ctx.setCurrentState(DeliveringState.instance());
    }
}
